package com.xbongbong.pro.statistic.model;

import com.xbongbong.pro.domain.entity.BiDataCorrEntity;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @author 梁鲁江
 * @version v1.0
 * @date 2019/3/20 10:16
 * @since v1.0
 */
public interface BiDataCorrModel {
     Integer insert(BiDataCorrEntity entity);

     Integer update(BiDataCorrEntity entity);

     Integer save(BiDataCorrEntity entity);

     void insertBatch(List<BiDataCorrEntity> entityList);

     Integer deleteByKey(Long id, String corpid);

     BiDataCorrEntity getByKey(Long id, String corpid);

     List<BiDataCorrEntity> findEntitys(Map<String, Object> param);


    /**
     * 获取在第一个位置的实体
     * @param corpid
     * @param appId
     * @param formId
     * @param saasMark
     * @param businessType
     * @param relTable
     * @param location
     * @return
     */
     BiDataCorrEntity findByLocation(String corpid,  Long formId, Integer location, String linkAttr, String linkAttrB, String linkAttrC, String linkAttrD, String linkAttrE) ;
     BiDataCorrEntity findByLocation(String corpid,  Long formId, Integer location, String linkAttr, String ... linkAttrB) ;

    /**
     *获取在不在第一个位置的实体
     * @param corpid
     * @param appId
     * @param formId
     * @param saasMark
     * @param businessType
     * @param relTable
     * @return
     */
     BiDataCorrEntity findSlaveLocation(String corpid,Long formId, String linkAttr);

     Integer getEntitysCount(Map<String, Object> param);

    /**
     * 更新对应id的
     * @param idIn
     * @return
     */
     Integer updateWarehouseTime(Set<Long> idIn);

     Integer updateSyscAll(Set<Long> idIn);
}
